<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>auto cheyun cms</title>

    <link href="<?php echo base_url(); ?>static/css/bootstrap.min.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>static/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>static/css/animate.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>static/css/plugins/summernote/summernote.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>static/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>static/css/style.css" rel="stylesheet">

    <!-- 导入jquery -->
    <script src="<?php echo base_url(); ?>static/js/jquery-2.1.1.js"></script>

</head>

<body>
	
	<div id="wrapper">
		<!-- 左侧菜单 -->
		<?php $this->load->view('admin/common/left.html'); ?>
		<div id="page-wrapper" class="gray-bg">
			<!-- 公共头部 -->
			<?php $this->load->view('admin/common/header.html'); ?>
			<!-- content 主区域 -->
			<div class="wrapper wrapper-content">
	            <div class="row">
	                <div class="col-lg-12">
		                <div class="ibox float-e-margins">
			                <div class="ibox-title">
								<h5>添加平台抓取规则 <small>（配置抓取规则xpath）</small></h5>
							</div>
							<div class="ibox-content">
								<form method="post" class="form-horizontal" id="platform">
									<div class="form-group"><label class="col-sm-1 control-label">规则名称</label>
                                    	<div class="col-sm-3"><input type="text" class="form-control" name="rule_title" value="<?php echo isset($rule['rule_title']) ? $rule['rule_title']:''; ?>"></div>
                                	</div>
                                	<div class="hr-line-dashed"></div>
									<div class="form-group"><label class="col-sm-1 control-label">入口地址</label>
                                    	<div class="col-sm-3"><input type="text" class="form-control" name="startUrl" value="<?php echo isset($rule['startUrl']) ? $rule['startUrl']:''; ?>"></div>
                                	</div>
                                	<div class="hr-line-dashed"></div>
                                    <div class="form-group"><label class="col-sm-1 control-label">分页规则</label>
                                        <div class="col-sm-3"><input type="text" class="form-control" name="pagination" value="<?php echo isset($rule['pagination']) ? $rule['pagination']:''; ?>"></div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                	<div class="form-group"><label class="col-sm-1 control-label">抓取区块</label>
                                    	<div class="col-sm-3"><input type="text" class="form-control" name="body" value="<?php echo isset($rule['body']) ? $rule['body']:''; ?>"></div>
                                	</div>
                                	<div class="hr-line-dashed"></div>
                                	<div class="form-group"><label class="col-sm-1 control-label">来源地址</label>
                                    	<div class="col-sm-3"><input type="text" class="form-control" name="linkUrl" value="<?php echo isset($rule['linkUrl']) ? $rule['linkUrl']:''; ?>"></div>
                                	</div>
                                	<div class="hr-line-dashed"></div>
                                	<div class="form-group"><label class="col-sm-1 control-label">文章标题</label>
                                    	<div class="col-sm-3"><input type="text" class="form-control" name="title" value="<?php echo isset($rule['title']) ? $rule['title']:''; ?>"></div>
                                	</div>
                                	<div class="hr-line-dashed"></div>
                                	<div class="form-group"><label class="col-sm-1 control-label">文章摘要</label>
                                    	<div class="col-sm-3"><input type="text" class="form-control" name="summary" value="<?php echo isset($rule['summary']) ? $rule['summary']:''; ?>"></div>
                                	</div>
                                	<div class="hr-line-dashed"></div>
                                	<div class="form-group"><label class="col-sm-1 control-label">缩略图</label>
                                    	<div class="col-sm-3"><input type="text" class="form-control" name="thumb" value="<?php echo isset($rule['thumb']) ? $rule['thumb']:''; ?>"></div>
                                	</div>
                                	<div class="hr-line-dashed"></div>
                                	<div class="form-group"><label class="col-sm-1 control-label">作者</label>
                                    	<div class="col-sm-3"><input type="text" class="form-control" name="author" value="<?php echo isset($rule['author']) ? $rule['author']:''; ?>"></div>
                                	</div>
                                	<div class="hr-line-dashed"></div>
                                	<div class="form-group"><label class="col-sm-1 control-label">发布时间</label>
                                    	<div class="col-sm-3"><input type="text" class="form-control" name="published" value="<?php echo isset($rule['published']) ? $rule['published']:''; ?>"></div>
                                	</div>
                                	<div class="hr-line-dashed"></div>
									<div class="form-group">
	                                    <div class="col-sm-4 col-sm-offset-2">
	                                        <button class="btn btn-primary" type="submit">保存</button>
	                                    </div>
	                                </div>
								</form>
							</div>
		                </div>
		            </div>
	            </div>
			</div>

            <?php $this->load->view('admin/common/footer.html'); ?>

		</div>
	</div>


    <!-- Mainly scripts -->
    <script src="<?php echo base_url(); ?>static/js/jquery-2.1.1.js"></script>
    <script src="<?php echo base_url(); ?>static/js/bootstrap.min.js"></script>
    <script src="<?php echo base_url(); ?>static/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="<?php echo base_url(); ?>static/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

    <!-- Custom and plugin javascript -->
    <script src="<?php echo base_url(); ?>static/js/inspinia.js"></script>
    <script src="<?php echo base_url(); ?>static/js/plugins/pace/pace.min.js"></script>

    <!-- Jquery Validate -->
    <script src="<?php echo base_url(); ?>static/js/plugins/validate/jquery.validate.min.js"></script>
	    <script>
         $(document).ready(function(){

             $("#platform").validate({
                 rules: {
                 	 rule_title: {
                 		required: true,	
                 	 },
                     startUrl: {
                         required: true,
                     },
                     body: {
                         required: true,
                     },
                     linkUrl: {
                         required: true,
                     },
                     title: {
                         required: true,
                     }
                 }
             });
        });
    </script>
</body>